package cn.school.test;

import cn.school.util.MybatisUtil;
import org.apache.ibatis.session.SqlSession;

import java.sql.Connection;

/**
 * @author oldliu
 * @since 1.0
 */
public class ConnectionPool {
    public static void main(String[] args) {
        //DataSource
       for(int i=1;i<=20;i++){
           SqlSession s= MybatisUtil.get();
           Connection connection = s.getConnection();
           System.out.println(connection.hashCode()+","+connection.getClass().getName());
           MybatisUtil.close(s);
       }
    }
}
